<?php

namespace App\Services\Account;

use Illuminate\Database\Eloquent\Relations\HasMany;

class AccountVipCards extends AccountAbstract
{
    protected function account(): HasMany
    {
        return $this->user->vipCards();
    }

    /*---------- plus --------------------------------------------------------------------------------------------------*/

	public function plusBuyVipCards($cards, $data = [])
	{
		$cards = big_decimal($cards);
		$this->record($cards, 'buy_vip_cards', '购买vip卡', $data);
	}

	public function plusgetVipCards($cards, $data = [])
	{
		$cards = big_decimal($cards);
		$this->record($cards, 'get_vip_cards', '接收vip卡', $data);
	}



	/*---------- minus -------------------------------------------------------------------------------------------------*/

	public function minusGiftVipCards($cards, $data = [])
	{
		$cards = big_decimal($cards)->multipliedBy(-1);
		$this->record($cards, 'gift_vip_card', '赠送vip卡', $data);
	}

	public function minusUseVipCards($cards, $data = [])
	{
		$cards = big_decimal($cards)->multipliedBy(-1);
		$this->record($cards, 'use_vip_card', '使用vip卡', $data);
	}
	

	public function minusSystemRecall($cards, $data = [])
	{
		$cards = big_decimal($cards)->multipliedBy(-1);
		$this->record($cards, 'system_recall', '系统回收', $data);
	}


	
}
